package com.sofwin.service.impl;

import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.RequestOriginParser;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @packageName: com.sofwin.service.impl
 * @author: andyliu
 * @date: 2022/5/23 10:39
 * @email 115176513@qq.com
 * @description: TODO
 */
@Component
public class RequestOrginImpl implements RequestOriginParser {
    @Override
    public String parseOrigin(HttpServletRequest request) {
        // 将来源隐藏header中
        // serverName==app
        // serverName==pc 来源pc
        String serverName = request.getParameter("serverName");
        return serverName;
    }
}
